addpath 'D:\matlab2022\bin\cmi'

lambda=0.6328;                                          % 入射波长，单位微米, 632.8nm
k0=2*pi/lambda;                                        
Nx =1200;                                              
range1=2000;

focallength=20000;
step1=range1/(Nx-1);                                     % 步距
yp1=-range1/2:step1:range1/2;
xp1=-range1/2:step1:range1/2;
[x1,y1]=meshgrid(xp1,yp1);                               % 划分网格
position1  = x1 + 1i * y1;                               % 某点的位置
lensletr = abs(position1);                               % 某点的半径
lensang  = angle(position1);
Nc=floor(Nx/2)+1;

TFZP= exp(-1i*pi*lensletr.^2/(lambda*focallength));
a=sign(real(TFZP));
lens1 =sign(1+sign(real(TFZP)));                              %元件的透过率函数二值化


